const express = require("express");
const path = require("path");

const app = express();
// static
app.use(express.static(path.join(__dirname, "public")));

app.set("views", path.join(__dirname, "public")); // specify the views directory
app.set("view engine", "pug"); // register the template engine
app.engine("html", require("pug").__express); // html后缀文件使用pug引擎解析

// app.get("/", function (req, res, next) {
//   res.header({
//     "Content-Type": "text/html; charset=utf-8",
//   });
//   res.render("index.html");
// });

module.exports = app;
